{include file="public/header" /}

<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>{$Think.lang.inquiry_title}</h3>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>

    <form method="get" name="formSearch" id="formSearch">
        <!--搜索商品-->
        <div class="ds-search-form">
            <dl>
                <dt>商品名称：</dt>
                <dd><input type="text" value="{$Request.get.goods_name|default=''}" name="goods_name" id="goods_name" class="txt"></dd>
            </dl>
            <dl>
                <dt>用户类型</dt>
                <dd id="searchgc_td"></dd>
                <dd>
                    <select name="user_type" id="">
                        <option value="">请选择用户类型</option>
                        <option value="1" {if condition="(!empty($Request.get.user_type) && $Request.get.user_type eq 1 )" } selected {/if} >普通用户</option>
                        <option value="2" {if condition="(!empty($Request.get.user_type) && $Request.get.user_type eq 2 )" } selected {/if} >运营商</option>
                    </select>
                </dd>
            </dl>
            <div class="btn_group">
                <a href="javascript:void(0);" id="dssubmit" class="btn" title="{$Think.lang.ds_query}">{$Think.lang.ds_query}</a>
                <a href="{:url('Goodinquiry/inquiry_history')}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
            </div>
        </div>
    </form>

    <table class="ds-default-table">
        <thead>
        <tr class="thead">
            <th>序号</th>
            <th>商品平台号</th>
            <th>用户类型</th>
            <th>商品数量</th>
            <th>商品名称</th>
            <th>{$Think.lang.inquiry_name}</th>
            <th>{$Think.lang.station_name}</th>
            <th>配置类型</th>
            <th>{$Think.lang.created_at}</th>
            <th>{$Think.lang.ds_handle}</th>
        </tr>
        </thead>
        <tbody>
        {notempty name="info_list"}
        {foreach name="info_list" item="v" key="k" }
        <tr class="hover edit" id="ds_row_{$v.id}">
            <td>{$v.id}</td>
            <td>{$v.goods_id}</td>
            <td>
                <?php echo ($v['type'] == 1) ? '普通用户' : '运营商' ;?>
            </td>
            <td>{$v.number}</td>
            <td>{$v.goods_name|default=''}</td>
            <td class="">{$v.inquiry_name|default=''}</td>
            <td class="">{$v.station_name|default=''}</td>
            <td class="">
                {foreach name="config_list" item="va" key="key" }
                <?php $config = explode(',',$v['good_config']); if(in_array($key,$config)) { echo "<span class='dsui-btn-edit'>".$va."</span>";}  ?>
                {/foreach}
            </td>
            <td> {$v.created_at} </td>
            <td>
                <a href="javascript:dsLayerConfirm('{:url('Goodinquiry/inquiry_del',['id'=>$v.id])}','{$Think.lang.ds_ensure_del}',{$v.id})" class="dsui-btn-del">
                    <i class="iconfont"></i>{$Think.lang.ds_del}
                </a>
            </td>
        </tr>
        {/foreach}
        {else /}
        <tr class="no_data">
            <td colspan="10">{$Think.lang.ds_no_record}</td>
        </tr>
        {/notempty}
        </tbody>
    </table>
</div>

<script type="text/javascript" src="{$Think.ADMIN_SITE_ROOT}/js/jquery.edit.js" charset="utf-8"></script>
<script>
    $(function (){
        $('#dssubmit').click(function(){
            $('#formSearch').submit();
        });
    });
</script>